package springboot.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import springboot.mapper.UserMapper;
import springboot.pojo.User;
import springboot.service.UserService;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper mapper;
    @Override
    public void insert(User user) {
        mapper.insert(user);

    }

    @Override
    public User getUserById(Integer id) {
        return  mapper.selectByPrimaryKey(id);
    }

    @Override
    public List<User> queryAll() {
        return mapper.selectAll();
    }
}
